package com.ruoyi.yanjing.domain.mqtt;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Date;
import java.util.List;

public class MqttReceiveData {
    @JsonProperty("gateway_id")
    private String gatewayId;

    private Date timestamp;

    /**
     * 电池电压，单位mV
     */
    @JsonProperty("batery_vol")
    private String bateryVol;

    /**
     * 电源状态，low,norm,full
     */
    @JsonProperty("power_stat")
    private String powerStat;

    public String getBateryVol() {
        return bateryVol;
    }

    public void setBateryVol(String bateryVol) {
        this.bateryVol = bateryVol;
    }

    public String getPowerStat() {
        return powerStat;
    }

    public void setPowerStat(String powerStat) {
        this.powerStat = powerStat;
    }

    private List<SensorData> sensors;

    // Getters and Setters
    public String getGatewayId() {
        return gatewayId;
    }

    public void setGatewayId(String gatewayId) {
        this.gatewayId = gatewayId;
    }

    public Date getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Date timestamp) {
        this.timestamp = timestamp;
    }

    public List<SensorData> getSensors() {
        return sensors;
    }

    public void setSensors(List<SensorData> sensors) {
        this.sensors = sensors;
    }

    // Nested class for sensor data
    public static class SensorData {
        @JsonProperty("sensor_id")
        private String sensorId;/*传感器ID*/

        private String temperature;

        @JsonProperty("online_flag")
        private String onlineFlag;	/*在线*/
        @JsonProperty("over_temp_cfg")
        private String overTempCfg;/*报警温度配置*/
        @JsonProperty("last_change_time")
        private Date lastChangeTime;/*温度最后改变时间*/

        public String getOnlineFlag() {
            return onlineFlag;
        }

        public void setOnlineFlag(String onlineFlag) {
            this.onlineFlag = onlineFlag;
        }

        public String getOverTempCfg() {
            return overTempCfg;
        }

        public void setOverTempCfg(String overTempCfg) {
            this.overTempCfg = overTempCfg;
        }

        public Date getLastChangeTime() {
            return lastChangeTime;
        }

        public void setLastChangeTime(Date lastChangeTime) {
            this.lastChangeTime = lastChangeTime;
        }

        // Getters and Setters
        public String getSensorId() {
            return sensorId;
        }

        public void setSensorId(String sensorId) {
            this.sensorId = sensorId;
        }

        public String getTemperature() {
            return temperature;
        }

        public void setTemperature(String temperature) {
            this.temperature = temperature;
        }
    }
}
